package com.Tradition.common.http;

/**
 * HttpEntity
 *
 * @author 朱笑
 * @date 2018-06-19 21:28
 */
public class HttpResult {
    private int code;
    private String msg;
    private Object data;
    public static HttpResult newInstance(HttpResultEnum entity){//创建对象
        HttpResult httpResult = new HttpResult();
        httpResult.setCode(entity.code);
        httpResult.setMsg(entity.msg);
        return httpResult;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
    public HttpResult withData(Object data){
        this.data=data;
        return this;
    }


}
